package com.day16.Poker;

import java.util.ArrayList;
import java.util.Collections;

public class PokerDemo {
    public static void main(String[] args) {
        ArrayList<String> array = new ArrayList<String>();
        String[] colors = {"红桃","黑桃","梅花","方块"};
        String[] numbers = {"3","4","5","6","7","8","9","10","J","Q","K","A","2"};
        for(String color:colors){
            for(String number:numbers){
                array.add(color+number);
            }
        }
        array.add("小王");
        array.add("大王");
        Collections.shuffle(array);
        ArrayList<String> lqxArray= new ArrayList<String>();
        ArrayList<String> lyArray= new ArrayList<String>();
        ArrayList<String> fqyArray= new ArrayList<String>();
        ArrayList<String> dpArray= new ArrayList<String>();
        for(int i=0;i<array.size();i++){
            String poker = array.get(i);
            if (i >= array.size() - 3) {
                dpArray.add(poker);
            } else if (i % 3 == 0) {
                lqxArray.add(poker);
            } else if (i % 3 == 1) {
                lyArray.add(poker);
            } else if (i % 3 == 2) {
                fqyArray.add(poker);
            }

        }
        lookPoker("丽群香",lqxArray);
        lookPoker("李阳",lyArray);
        lookPoker("方庆阳",fqyArray);
        lookPoker("底牌",dpArray);
    }
    public static void lookPoker(String name,ArrayList<String> array){
        System.out.print(name+"的牌是：");
        for(String poker:array){
            System.out.print(poker+" ");
        }
        System.out.println();
    }
}

